package srzy.common

import org.apache.log4j.{ PropertyConfigurator, Logger }
import java.io.File

object LogUtil {

  //  val in = this.getClass().getClassLoader().getResourceAsStream("log.properties")
  val in = this.getClass().getClassLoader().getResourceAsStream("log4j.xml")
  PropertyConfigurator.configure(in)

  //  PropertyConfigurator.configure("etc" + File.separator + "log.properties")
  def getLogger(clazz: Class[_]): Logger = {
    Logger.getLogger(clazz)
  }

}

trait Logging {
  protected lazy val logger: Logger = LogUtil.getLogger(getClass())
}